{	Problem: http://codeforces.ru/problemset/problem/81/C
 	Verdict: Accepted
}
var 
    i,n,a,b,c,v,cc:longint;
    r,t:array[0..1000010] of longint;
begin
fillchar(r,sizeof(r),0);
read(n);
read(a,b);
for i:=1 to n do read(t[i]);
if a=b then begin
    for i:=1 to n do
        if i<=a then r[i]:=1 else r[i]:=2;
end else begin
    if a>b then begin
        cc:=b;
        v:=2;
    end else begin
        cc:=a;
        v:=1;
    end;
    c:=5;
    while cc>0 do begin
        if v=2 then begin
            for i:=n downto 1 do
                if t[i]=c then begin
                    r[i]:=v;
                    dec(cc);
                    if cc=0 then break;
                end;    
        end else begin
            for i:=1 to n do 
                if t[i]=c then begin
                    r[i]:=v;
                    dec(cc);
                    if cc=0 then break;
                end;
        end;
        dec(c);
    end;
    for i:=1 to n do 
        if r[i]=0 then r[i]:=3-v;
end;
for i:=1 to n do write(r[i],' ');
end.  